<form action="advertisement.manage.php?action=save" method="post" enctype="multipart/form-data" id="form_add" name="form_add" style="padding-bottom:20px" ><table class="from_table">
  		<tr>
			<th class="th2"><tpl> $langOtherTransferCode </tpl>：</th>
			<td width="530" class="td1"><input name='txt_code' type='text' id="txt_code" class="txtinput"/></td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherTitle </tpl>：</th>
			<td width="530" class="td1"><input name='txt_title' type='text' id="txt_title" class="txtinput"/>
			<label style="display:none" for="txt_title" class="wrong" metaDone="true" generated="true"></label>			</td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherAddType </tpl>：</th>
			<td width="530" class="td1"><tpl> $txt_type </tpl></td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherImage </tpl>：</th>
			<td width="530" class="td1"><input name='txt_pic' type='file' id="txt_pic"/></td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherLink </tpl>：</th>
			<td width="530" class="td1"><input name='txt_url' type='text' value="http://" id="txt_url" class="txtinput"/>
			<label style="display:none" for="txt_url" class="wrong" metaDone="true" generated="true"></label>			</td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherDisTime </tpl>：</th>
			<td width="530" class="td1">
			<input type="text" name="txt_start_date" id="s_date"  style="border:solid 1px #B0DF82;cursor:pointer; width:100px; background:url(../js/calendar/blue/cal_btn.gif) no-repeat right; height:18px; padding-right:19px;" readonly="readonly" /> <tpl> $langOtherTo </tpl>
  	    	<input type="text" name="txt_end_date" id="e_date" style="border:solid 1px #B0DF82;cursor:pointer; width:100px; background:url(../js/calendar/blue/cal_btn.gif) no-repeat right; height:18px; padding-right:19px; " readonly="readonly" />			</td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langOtherAdvBulk </tpl>：</th>
			<td width="530" class="td1"><tpl> $langOtherWidth </tpl>：<input type="text" name="txt_width" id="txt_width" class="txtinput_short" size="6" />&nbsp;px &nbsp;&nbsp;<tpl> $langOtherHigth </tpl>：<input type="text" name="txt_heigth" size="6" id="txt_heigth" class="txtinput_short"/>&nbsp;px
			<label style="display:none" for="txt_width" class="wrong" metaDone="true" generated="true"></label>
			<label style="display:none" for="txt_heigth" class="wrong" metaDone="true" generated="true"></label>			</td>
		</tr>
		<tr>
			<th class="th2"><tpl> $langCSort </tpl>：</th>
			<td width="530" class="td1"><input type="text" name="txt_sort" id="txt_sort" class="txtinput_short" size="4" value="0" />  <span>*<tpl> $langOtherDisGear </tpl></span>
			<label style="display:none" for="txt_sort" class="wrong" metaDone="true" generated="true"></label>			</td>
		</tr>
		
	</table>
	<div class="table-5-bottom"> <div class="p-left-2"><span class="btn_left"><input type="submit"  value="<tpl> $langOtherSubmit </tpl>" class="btn_submit" /></span>
			 <span class="btn_left"><input type="button" value="<tpl> $langOtherReturn </tpl>" class="btn_submit" onclick="location.href='advertisement.manage.php?action=list'"/></span>	</div></div>
</form>
<script>
$(document).ready(function() {
	var options_add = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ST(0,0);
								$("#select_type").css("display","");
								ShowDiv = "result_content";
								getPageContent("advertisement.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	$("#form_add").validate({
		errorClass: "wrong",
		rules: {
			txt_title: {required:true},
			txt_url: {required:true},
			txt_code: {required:true},
			txt_start_date: {required:true},
			txt_end_date: {required:true},
			txt_width: {number:true},
			txt_heigth: {number:true},
			txt_sort: {number:true}
		},
		messages: {
			txt_title: {required:"<tpl> $langOtherAdvTitleNotNull </tpl>"},
			txt_url: {required:"<tpl> $langOtherAdvLinkNotNull </tpl>"},
			txt_code: {required:"<tpl> $langOtherTransferCodeNotNull </tpl>"},
			txt_start_date: {required:"<tpl> $langOtherBeginTimeNotNull </tpl>"},
			txt_end_date: {required:"<tpl> $langOtherEndTimeNotNull </tpl>"},
			txt_width: {number:"<tpl> $langOtherAdvMustIsNum </tpl>"},
			txt_heigth: {number:"<tpl> $langOtherAdvMustIsNum </tpl>"},
			txt_sort: {number:"<tpl> $langOtherAdvMustIsNum </tpl>"}
		},
		submitHandler: function() {
			$('#form_add').ajaxSubmit(options_add);
		}
	});
});	

$(function(){
   $("#s_date").datepicker();
   $("#e_date").datepicker();
})
function ajax_change(id){
	hideMessage();
	ShowDiv = "result_content";
	getPageContent("advertisement.manage.php?action=ajax_list&select_type="+id);
	
}
</script>